<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<s:head />
		<s:i18n name="globalMessages"></s:i18n>
		<base href="<%=basePath%>" />
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title></title>
		<script type='text/javascript' src='js/jquery-1.4.2.min.js'></script>
		<script type='text/javascript' src='js/jquery.validate.min.js'></script>
		<script type='text/javascript' src='js/common.js'></script>
		<script type='text/javascript' src='js/jquery-ui-1.7.3.custom.min.js'></script>  
		<link href="style/ui-lightness/jquery-ui-1.7.3.custom.css" rel="stylesheet" type="text/css">
		<link href="style/index.css" rel="stylesheet" type="text/css" />
		<link href="style/valid.css" rel="stylesheet" type="text/css" />
		<link href="images/css.css"  rel="stylesheet" type="text/css" />
			<style type="text/css">
				a:link {
					text-decoration: none;
				}
				a:visited {
					text-decoration: none;
				}
				a:hover {
					text-decoration: none;
				}
				a:active {
					text-decoration: none;
				}
				.STYLE10 {
					font-size: 14px;
					font-weight: bold;
				}
		</style>
		<script type=text/javascript>
		//转至多少页码
		 function changePage(pageNo, typeid, groupid)
		 {
		 	//alert(listId);
		  window.location.href="indexAction!findByTypeAndGroup.action?pageNo=" +pageNo + "&typeId=" + typeid + "&groupId=" + groupid ;
		 } 
		function initYulan() {
			var arr = $(".yulancls");
			$.each( arr, function(i, el){
				 var divHeight = $(".zhenshu" + $(el).attr("msgid")).length * 240;
				 $(el).dialog({title:"彩信预览", resizable:false,  width: divHeight,autoOpen: false});
			}); 
			
		}

		 //预览
		   function previewMsg(idx) {
			   $("#yulanDiv" + idx).dialog('open');
		   }

		   function openYulan(msgid) {
		   }
		</script>
	</head>
<body  bgcolor="#F1F1F1" style="margin:0px; text-align:center;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
  <tr><td width="794">
      
        <tr>
        <tr>
                <td width="1%" height="32" background="images/sp_bg.jpg">&nbsp;</td>
                <td width="3%" align="center" background="images/sp_bg.jpg" style="border-bottom:1px solid #C5C5C5;"><img src="images/dian.jpg" width="10" height="16" /></td>
                <td width="90%" align="left" background="images/sp_bg.jpg" style="border-bottom:1px solid #C5C5C5;"><span class="STYLE3" >${typeObj.name} </span></td>
                <td width="6%" align="left" background="images/sp_bg.jpg">
                </td>
              </tr>
      <!-- 开始循环 -->
      	<s:if test="pageObj.data!=null  && pageObj.data.size()>0">
      	<s:iterator value="pageObj.data" id="msg" status="st">
      	<s:if test="(st.index)%5==0">
      		<tr>
      	</s:if>
          <td height="220" align="center" valign="top" bgcolor="#FFFFFF" style="border:1px solid #C5C5C5; padding:1px ;">
              <table width="" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="8">&nbsp;</td>
                </tr>
              </table>
            <table  border="0" cellpadding="0" cellspacing="0" align="left">
                <div id="images2">
                  <tr>
                    	<td width="150" height="85" align="center"><p >
                    		<s:if test="msg.manageMsgDetails[0]==null || msg.manageMsgDetails[0].pic == null || msg.manageMsgDetails[0].pic == ''">
                    			<img src="images/default_msg_pic.jpg" align="center" /></p>
                    		</s:if>
                    		<s:else>
                    			<img src="<s:property value="msg.manageMsgDetails[0].pic"/>" align="center" /></p>
                    		</s:else>
                    	</td>
                  </tr>
                  <tr>
                    	<td height="24" align="left"><div class="STYLE11 texthide" style="height:30px; width:120px;text-align: center;padding-left: 5px;">${msg.title}</div></td>
                  </tr>
                  <tr >
                    	<td align="left" class="di_ys " ><div style="padding-left: 20px;">
                    	<a href="msg!sendPage.action?first=1&mubanId=${msg.id}"  >发送</a>&nbsp;&nbsp;&nbsp;&nbsp;
                    	<a href="mobanListAction!yulan.action?id=${msg.id }" target="_blank">预览</a>&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
                  </tr>
                </div>
            </table>
            </td>
        <s:if test="st.index%5==0">
      		</tr>
      	</s:if>
        </s:iterator>
        </s:if>
      </table>
      
      
      <table width="200" border="0" cellspacing="0" cellpadding="0" height="7">
          <s:if test="pageObj.data != null">
			<s:if test="pageObj.hasOnePage==false">
			<form action="indexAction!findByTypeAndGroup.action?typeId=${typeId}&groupId=${groupId}" method="get" id="suofrm" name="suofrm">
            <tr>
              <td height="29" colspan="13" align="right" background="images/lm1_bg.jpg" >
              <s:if test="pageObj.pageNo==1">首页</s:if>
			  <s:else>
				  <a href="indexAction!findByTypeAndGroup.action?typeId=${typeId}&groupId=${groupId}&pageNo=1" class="STYLE5">首页</a> 
			  </s:else>&nbsp;
              
              <s:if test="pageObj.hasPrePage==false">上一页</s:if>
			  <s:else> 
				 <a href="indexAction!findByTypeAndGroup.action?typeId=${typeId}&groupId=${groupId}&pageNo=<s:property value="pageObj.pageNo-1"/>" class="STYLE5">上一页</a>
			  </s:else>&nbsp;

              <s:if test="pageObj.hasNextPage==false">下一页</s:if>
		      <s:else>
				 <a href="indexAction!findByTypeAndGroup.action?typeId=${typeId}&groupId=${groupId}&pageNo=<s:property value="pageObj.pageNo+1"/>" class="STYLE5">下一页</a>
			  </s:else>&nbsp;
              
              <s:if test="pageObj.pageNo==pageObj.totalPage">末页</s:if>
			  <s:else>
			    <a href="indexAction!findByTypeAndGroup.action?typeId=${typeId}&groupId=${groupId}&pageNo=<s:property value="pageObj.totalPage"/>" class="STYLE5"> 末页 </a>
			  </s:else>
              
              &nbsp;&nbsp;第${pageObj.pageNo}页&nbsp;|&nbsp;
                                    共<s:property value="pageObj.totalPage"/>页&nbsp;|&nbsp;
                                    共${pageObj.totalRecord}条&nbsp;&nbsp;转至&nbsp;
    			<select onchange="changePage(this.value, ${typeId}, ${groupId})" id="pageNo" name="pageNo">
    				<s:iterator value="pageObj.listNum" id="msgid" status="st">
    					<option value="<s:property value="pageObj.listNum[#st.index]"/>"><s:property value="pageObj.listNum[#st.index]"/></option>
    				</s:iterator>
    			</select>&nbsp;&nbsp;
    		</td>
            </tr>
            </form>
             </s:if>
             <s:else>
				<%--<font class="tip" style="font-size: large;">暂无消费明细!</font>--%>
				<tr>
	              <td height="29" colspan="13" align="right" background="images/lm1_bg.jpg" >
				 	首页&nbsp;上一页&nbsp;下一页&nbsp;末页           
	              	&nbsp;&nbsp;第1页&nbsp;|&nbsp;共1页&nbsp;|&nbsp;&nbsp;
	    		  </td>
	            </tr>
		     </s:else>
  		</s:if>
  		<s:else>
	  		<tr>
		        <td height="29" colspan="13" align="right" background="images/lm1_bg.jpg" >
					<p style="color: red;font-size: 12px;text-align: center;">暂无记录!</p>
		    	</td>
		    </tr>	 
  		</s:else>	 
          
        </tr>
      </table>
     
      </td></tr></table>
      
<s:iterator value="typeMsgList" var="typeItem" status="typeSt">      
<s:iterator value="#typeItem.manageMsgs" var="msg" status="st">
<!-- 预览效果的div -->
<div id="yulanDiv${msg.id}"  msgid="${msg.id}" style="display: none;" class="yulancls">
	<table cellspacing="0" cellpadding="0" border="0">
		<tr>
			<s:iterator var="item" value="#msg.manageMsgDetails">
			
			<td>
				<table cellspacing="0" cellpadding="0" border="0" width="216" height="424">
					        <tbody><tr>
					          <td align="center" width="216" valign="top" height="424"><table cellspacing="0" cellpadding="0" border="0" width="206" height="424">
					            <tbody><tr>
					              <td height="55" colspan="3"><img width="217" height="75" src="images/z_top.jpg"></td>
					            </tr>
					            <tr>
					              <td width="19" height="273"><img width="18" height="275" src="images/z_left.jpg"></td>
					              <td width="182" valign="top"><table cellspacing="0" cellpadding="0" border="0" align="center" width="181"  >
					                  <tbody><tr>
					                    <td width="185" height="140">
					                    	<s:if test="#item==null || #item.pic==null">
					                    		<img width="181" height="153" src="images/zlzjpg.jpg">
					                    	</s:if>
					                    	<s:else>
					                    		<img  width="181" height="153" src="<s:property value="#item.pic"/>" />
					                    	</s:else>
					                    </td>
					                  </tr>
					                  <tr>
					                    <td height="117">
					                    <s:if test="#item==null || #item.txt == null || #item.txt==''">
				                    		<textarea style="border:0px; height:115px;  width:181px; color:#000000;" disabled="disabled" cols="30" name="grjj">彩信文字内容</textarea>
				                    	</s:if>
				                    	<s:else>
						                    <textarea disabled="disabled" style="border:0px; height:115px;  width:181px; color:#000000;" cols="30" name="grjj"><s:property value="#item.txt"/></textarea>
					                    </s:else>
					                    
						          </td>
					                  </tr>
					              </tbody></table></td>
					              <td width="16"><img width="16" height="275" src="images/z_right.jpg"></td>
					            </tr>
					            <tr>
					              <td height="74" colspan="3"><img width="217" height="74" src="images/z_end.jpg"></td>
					            </tr>
					          </tbody></table></td>
					        </tr>
					      </tbody>
				</table>
			</td>
			</s:iterator>
			
		</tr>
		<tr>
			<s:iterator var="item2" value="#msg.manageMsgDetails">
			<td align="center" class="zhenshu${msg.id}">
				第${item2.zhenNo}帧
			</td>
			</s:iterator>
		</tr>
	</table>
</div>
</s:iterator>
</s:iterator>
<script type="text/javascript" defer="defer">
initYulan();
</script>


</body>
</html>
<script>
function open1(url)
{
var r=parseInt(Math.random()*1000);
window.showModalDialog(url,window,'status:no;help:no;dialogHeight:360px; dialogWidth:450px');
}
function open2(url)
{
window.showModalDialog(url,window,'status:no;help:no;dialogHeight:900px; dialogWidth:930px');
}
</script>
